package single_game.logic.race_simulator.race_team.rider_actions;

import single_game.logic.race_simulator.Group;
import single_game.logic.race_simulator.RaceSimulator;
import single_game.logic.race_simulator.race_team.RaceRider;
import main.CyclingManager;

public class InRelayQueue {
	
	public static void simulateRiderAction(RaceRider rider) {
		
		Group group = RaceSimulator.findGroupById(rider.getGroupId());
		
		if (rider.getEnergy() < 20.0) {
			rider.setAction("Maintain Position");
			group = RaceSimulator.findGroupById(rider.getGroupId());
			group.removeFromRelayGroup(rider);
			System.out.println("Relay Queue -> Maintain "+CyclingManager.getInstance().cyclists.get(rider.getCyclistId()).getSurname()+" "+rider.getRiderRole());
		}
	}
}
